package com.example;

import java.lang.reflect.InvocationTargetException;

/**
 * @ClassName InterceptImpl
 * @Description
 * @Author Yin
 * @Date 2021/4/11 23:16
 * @Version 1.0
 */
public class InterceptImpl implements Intercept {
    @Override
    public boolean before() {
        System.out.println("before....");
        return true;
    }

    @Override
    public void after() {
        System.out.println("after...");
    }

    @Override
    public Object around(Invocation invocation) throws InvocationTargetException, IllegalAccessException {
        System.out.println("around ...");
        invocation.proceed();
        return null;
    }

    @Override
    public void afterReturning() {
        System.out.println("afterRetuning");
    }

    @Override
    public void afterThrowing() {
        System.out.println("afterThrowing");
    }

    @Override
    public boolean useAround() {
        return true;
    }
}
